using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DestroySelf : MonoBehaviour
{
    private ParticleSystem particleSys;

    private void Start()
    {
        particleSys = GetComponent<ParticleSystem>();
    }

    private void Update()
    {
        if(particleSys && !particleSys.IsAlive())
        {
            DestroySelfObject();
        }
    }

    public void DestroySelfObject()
    {
        Destroy(gameObject);
    }

}
